#include <cstdio>
#include <iostream>
//?1.which constuctor will be called when use pointer to base class? 
//?2.Can abstract class be defined? No.
//?3.Can virtual member function have different return type? No!
//<error: conflicting return type sepcified for virtual member function>

using namespace std;
class Base{
public:
  virtual void pure() =0;
  virtual void fire(){cout<<"Base::fire()"<<endl;}
  virtual ~Base(){cout<<"~Base()"<<endl;}
};


class Derived : public Base {
public:
  void fire(){cout<<"Derived::fire()"<<endl;}
  ~Derived(){cout<<"~Derived()"<<endl;}
};

int main()
{
  //if inherited from Base private
  //error: 'Base' is an inaccessible base of 'Derived'
  Base *bptr = new Derived();
  delete bptr;
}
//************Answer 1**************
//if destructor is not virtual, call'~Base'

//else call ~Derive(), and then ~Base()
